package com.starmark.gateway.auth.provider.mapper;



import com.starmark.core.framework.base.SuperMapper;
import com.starmark.gateway.auth.provider.entity.GatewayAuthRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author starmark
 * @since 2018-04-27
 */
@Mapper
public interface GatewayAuthRoleMapper extends SuperMapper<GatewayAuthRole> {

    /**
     * 通过组织ID,查找对应的角色数据
     *
     * @param orgIds 组织ID
     * @param projectCode 工程编码
     * @return 角色ID组合
     */
    Set<String> getRoleIdsByOrgId(@Param("orgIds") List<String> orgIds,@Param("projectCode")String projectCode);

    /**
     * 判断当前用户是否超管
     * @param orgId 用户ID
     * @param projectCode 工程编码
     * @return 是否超级管理员
     */
    boolean  isAdmin(@Param("orgId") String orgId,@Param("projectCode")String projectCode);
}